﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using System;

public class UnitSel : MonoBehaviour
{
    public string UnitType;
    public EditorManager EMgr;

    public void OnClick()
    {
        UnitEditor e = null;
        if (UnitType == "Gear")
            e = EMgr.AddUnitAt<Gear>("gear", Vector2.zero);
        else if (UnitType == "Stick")
            e = EMgr.AddUnitAt<Stick>("stick", Vector2.zero);

        e.Refresh();
        e.Selected = true;
    }
}
